package com.ease.oxm.jaxb;

import java.util.Date;

import javax.xml.bind.annotation.adapters.XmlAdapter;

import com.ease.common.util.DateFormatUtil;

/**
 * 
 * @author nathanleewei
 * 
 */
public class DateTimeAdapter extends XmlAdapter<String, Date> {

	public String marshal(Date date) throws Exception {
		return DateFormatUtil.toDatetimeString(date);
	}

	public Date unmarshal(String v) throws Exception {
		return DateFormatUtil.toDatetime(v);
	}

}
